<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    if (null) {
      console.log("null is true");
    } else {
      console.log("null is false");
    }

    if (undefined) {
      console.log("undefined is true");
    } else {
      console.log("undefined is false");
    }

    if (0) {
      console.log("0 is true");
    } else {
      console.log("0 is false");
    }


    if ("") {
      console.log("\'\' is true");
    } else {
      console.log("\'\' is false");
    }

    if ("a") {
      console.log("\'a\' is true var");
    }

    let b1 = new Boolean(false);

    if (b1.valueOf()) {
      console.log("b1 原始值 is ture var");
    } else {
      console.log("b1 原始值 is false var");
    }

    if (!!b1) {
      console.log("b1 is ture var");
    } else {
      console.log("b1 is false var");
    }
    // 总结：!! 相当于调用了转化函数 Boolean()
  </script>
</body>

</html>